package org.example.projectdemo.advice;

import lombok.Data;
import java.util.Map;

@Data
public class ErrorResponse {
    private String code;
    private String message;
    private Long timestamp;
    private Map<String, String> errors; // 用于字段验证错误

    public ErrorResponse() {
        this.timestamp = System.currentTimeMillis();
    }

    public ErrorResponse(String code, String message) {
        this.code = code;
        this.message = message;
        this.timestamp = System.currentTimeMillis();
    }
    
    public ErrorResponse(String code, String message, Map<String, String> errors) {
        this.code = code;
        this.message = message;
        this.errors = errors;
        this.timestamp = System.currentTimeMillis();
    }
}